<?php

namespace app\admin\validate\Coupon;

use think\Validate;

class BrandType extends Validate
{
    protected $rule = [
        'id'     => 'require',
        'name'   => 'require|max:25',
        'status' => 'require|in:1,0',
        'sort'   => 'require|number|egt:1',
    ];

    protected $message = [
        'id.require'     => 'id错误！',
        'name.require'   => '充值类型名称不能为空',
        'name.max'       => '充值类型名称不能超过25个字符',
        'status.require' => '状态不能为空',
        'status.in'      => '状态参数只是是0或者1',
        'sort.require'   => '排序不能为空',
        'sort.number'    => '排序必须是数字',
        'sort.egt'       => '排序必须大于等于1',
    ];

    protected $scene = [
        'add_brand_type'  => ['name',"brand_id",'status','sort'],
        'edit_brand_type' => ['id', 'name',"brand_id",'status','sort'],
        'set_status'      => ['id','status']
    ];
}
